package mhys.View.Admin;

import javax.swing.*;
import java.awt.*;

public class MenuJpanel extends JPanel {
    public MenuJpanel(){
        this.setPreferredSize(new Dimension(0, 30));
        this.setLayout(new GridLayout(1,1,0,0));
        JMenuBar menuBar = new JMenuBar();
        JMenu fileMenu = new JMenu("文件");
        JMenu helpMenu = new JMenu("帮助");
        JMenuItem fMenuItem = new JMenuItem("打开");
        JMenuItem newMenuItem = new JMenuItem("新建");
        JMenuItem sysMenuItem = new JMenuItem("设置");
        fileMenu.add(fMenuItem);
        fileMenu.add(newMenuItem);
        fileMenu.add(sysMenuItem);
        menuBar.add(fileMenu);
        menuBar.add(helpMenu);
        fileMenu.setPreferredSize(new Dimension(50, 30));
        fMenuItem.setPreferredSize(new Dimension(100, 30));
        this.add(menuBar);
    }
}
